import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

import 'found_rank_mods/found_rank_2.dart';
import 'found_rank_mods/found_rank_4.dart';

class found_rank_mod extends StatefulWidget {
  found_rank_mod({Key key, this.rank_id}) : super(key: key);
  int rank_id;
  @override
  State<found_rank_mod> createState() => _found_rank_modState();
}

class _found_rank_modState extends State<found_rank_mod> {
  List cartoon_rank = [
    {
      'cartoon_id': 1007,
      'imageUrl': 'http://www.itying.com/images/flutter/1.png',
      'name': 'haihaihai',
      'author': '尾田荣一郎',
      'tage': 'rexue',
      'stae': '连载中'
    },
    {
      'cartoon_id': 1007,
      'imageUrl': 'http://www.itying.com/images/flutter/1.png',
      'name': 'haihaihai',
      'author': '尾田荣一郎',
      'tage': 'rexue',
      'stae': '连载中'
    },
    {
      'cartoon_id': 1007,
      'imageUrl': 'http://www.itying.com/images/flutter/1.png',
      'name': 'haihaihai',
      'author': '尾田荣一郎',
      'tage': 'rexue',
      'stae': '连载中'
    },
    {
      'cartoon_id': 1007,
      'imageUrl': 'http://www.itying.com/images/flutter/1.png',
      'name': 'haihaihai',
      'author': '尾田荣一郎',
      'tage': 'rexue',
      'stae': '连载中'
    },
    {
      'cartoon_id': 1007,
      'imageUrl': 'http://www.itying.com/images/flutter/1.png',
      'name': 'haihaihai',
      'author': '尾田荣一郎',
      'tage': 'rexue',
      'stae': '连载中'
    },
    {
      'cartoon_id': 1007,
      'imageUrl': 'http://www.itying.com/images/flutter/1.png',
      'name': 'haihaihai',
      'author': '尾田荣一郎',
      'tage': 'rexue',
      'stae': '连载中'
    },
    {
      'cartoon_id': 1007,
      'imageUrl': 'http://www.itying.com/images/flutter/1.png',
      'name': 'haihaihai',
      'author': '尾田荣一郎',
      'tage': 'rexue',
      'stae': '连载中'
    },
    {
      'cartoon_id': 1007,
      'imageUrl': 'http://www.itying.com/images/flutter/1.png',
      'name': 'haihaihai',
      'author': '尾田荣一郎',
      'tage': 'rexue',
      'stae': '连载中'
    },
    {
      'cartoon_id': 1007,
      'imageUrl': 'http://www.itying.com/images/flutter/1.png',
      'name': 'haihaihai',
      'author': '尾田荣一郎',
      'tage': 'rexue',
      'stae': '连载中'
    },
  ];
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Column(
        children: [
          Row(
            children: [
              Container(
                  margin: EdgeInsets.only(left: 20, top: 20),
                  child: Text(
                    '2月飙升榜',
                    style: TextStyle(fontSize: 16),
                  )),
            ],
          ),
          Column(children: [
            Container(
              margin: EdgeInsets.all(12),
              height: 170,
              width: 320,
              decoration: new BoxDecoration(
                color: Colors.black12,

                // 设置四周圆角，角度
                borderRadius: BorderRadius.all(Radius.circular(4.0)),
              ),
              child: Stack(children: [
                Container(
                  // height: 318,
                  width: 320,
                  child: Image(
                    fit: BoxFit.fill,
                    image: NetworkImage(cartoon_rank[0]['imageUrl']),
                  ),
                  // child: cartoon_rank[0]['imageUrl'],
                ),
                Image.asset('assets/images/common/cartoon/rank_biaoqian.png'),
                Container(
                  margin: EdgeInsets.all(4),
                  child: Text(
                    'No.1',
                    style: TextStyle(fontSize: 8),
                  ),
                )
              ]),
            ),
            Container(
              width: 320,
              child: Row(children: [
                Container(
                  margin: EdgeInsets.only(top: 4, bottom: 4),
                  width: 320,
                  child: Text(
                    cartoon_rank[0]['name'],
                    style: TextStyle(fontSize: 14),
                  ),
                ),
              ]),
            ),
            Container(
              width: 320,
              child: Row(children: [
                Container(
                  margin: EdgeInsets.only(top: 4, bottom: 4),
                  width: 320,
                  child: Text(
                    cartoon_rank[0]['name'],
                    style: TextStyle(fontSize: 12, color: Colors.black54),
                  ),
                ),
              ]),
            ),
          ]),
          Container(
            // color: Colors.red,
            width: 330,
            alignment: Alignment.center,
            child: Row(children: [
              found_rank_2(
                rank: 2,
                cartoon_id: cartoon_rank[1]['cartoon_id'],
                cartoon_name: cartoon_rank[1]['name'],
                cartoon_img: cartoon_rank[1]['imageUrl'],
                cartoon_value: cartoon_rank[1]['tage'],
              ),
              Expanded(child: SizedBox()),
              found_rank_2(
                rank: 3,
                cartoon_id: cartoon_rank[2]['cartoon_id'],
                cartoon_name: cartoon_rank[2]['name'],
                cartoon_img: cartoon_rank[2]['imageUrl'],
                cartoon_value: cartoon_rank[2]['tage'],
              ),
            ]),
          ),
          Container(
            width: 330,
            child: Row(children: [
              found_rank_2(
                rank: 4,
                cartoon_id: cartoon_rank[3]['cartoon_id'],
                cartoon_name: cartoon_rank[3]['name'],
                cartoon_img: cartoon_rank[3]['imageUrl'],
                cartoon_value: cartoon_rank[3]['tage'],
              ),
              Expanded(child: SizedBox()),
              found_rank_2(
                rank: 5,
                cartoon_id: cartoon_rank[4]['cartoon_id'],
                cartoon_name: cartoon_rank[4]['name'],
                cartoon_img: cartoon_rank[4]['imageUrl'],
                cartoon_value: cartoon_rank[3]['tage'],
              ),
            ]),
          ),
          Container(
            width: 330,
            child: Row(children: [
              found_rank_4(
                rank: 6,
                cartoon_id: cartoon_rank[5]['cartoon_id'],
                cartoon_name: cartoon_rank[5]['name'],
                cartoon_img: cartoon_rank[5]['imageUrl'],
              ),
              found_rank_4(
                rank: 7,
                cartoon_id: cartoon_rank[6]['cartoon_id'],
                cartoon_name: cartoon_rank[6]['name'],
                cartoon_img: cartoon_rank[6]['imageUrl'],
              ),
              found_rank_4(
                rank: 8,
                cartoon_id: cartoon_rank[7]['cartoon_id'],
                cartoon_name: cartoon_rank[7]['name'],
                cartoon_img: cartoon_rank[7]['imageUrl'],
              ),
              found_rank_4(
                rank: 9,
                cartoon_id: cartoon_rank[8]['cartoon_id'],
                cartoon_name: cartoon_rank[8]['name'],
                cartoon_img: cartoon_rank[8]['imageUrl'],
              ),
            ]),
          ),
        ],
      ),
    );
  }
}
